# Solution L2-C2

## Summary
Here are the correct statements in this question:

* Statement A is wrong.
* Statement B is correct.
* Statement C is wrong.
* Statement D is correct.

## Justification

The question is about using the Hough transform in computer vision, trying to solve a task of analysis of an aerial image showing a road and a track. On the right are illustrated the image that has been processed (fig1) and the graph of the hough transform (fig2). The graph shows all values of angles from -90º to 90º and signed radius as ratio in the image going from -1 to 1. The question is: "For a drone following the traffic from the air, vision is used to follow the road. Your colleague shows you one test where they used Hough transform (fig2) to track the orientation and placement of the road (fig1). What statements can you make using the transform shown in (fig2) (several answers
possible)? Radius is relative to the center of the image, the angle is counterclockwise with a zero set vertically.". 

Four Statements are proposed:

- Statements A: "We can see from (fig2) that the road is more or less going through the center of the image and, in respect to the horizontal line, around 30 degrees of angle (around 60 from vertical line)"
*This statement is wrong*: With the current coordinates, the angle values are not set correctly, making that the figure in (fig2) cannot be the correct Hough transform of the image in (fig1). At angle=0 the radius is computed from the center vertically to the top of the image. The integration of the pixels is done on a line which is perpendicular. The main road, which corresponds to the main white spot in Fig2, should then be at an angle of 30 degrees (the angle is counterclockwise), not an angle of -60 degrees. The angle of the Hough transform is the angle of the line originating from the center. The integration of the pixels is done on a perpendicular line.
In the explanation of the student we would like to see that they can set correctly the coordinates, showing this transform is the wrong one.

- Statements B: "The transform (fig2) cannot be the one of the image (fig1), as the coordinate system is not matching the basic theory of the transform."
*This statement is correct*: The Hough transform in (fig2) cannot be the one of the image because of the current coordinates set up doesn't match. At angle=0 the radius is computed from the center vertically to the top of the image. The integration of the pixels is done on a line which is perpendicular. The main road, which corresponds to the main white spot in Fig2, should then be at an angle of 30 degrees (the angle is counterclockwise), not an angle of -60 degrees. The angle of the Hough transform is the angle of the line originating from the center. The integration of the pixels is done on a perpendicular line.
In the explanation of the student we would like to see that they can set correctly the coordinates, showing this transform is the wrong one.

- Statements C: "The truck is 60 degrees aways from the center of the image, nearly centered on the road (in respect to the whole image)."
*This statement is wrong*: This is a confusing answer with no sense, as we cannot measure a distance in degrees.
In the explanation of the student we would like them to state that a distance cannot be measured in degrees.

- Statements D: "In general one cannot apply the Hough transform on the raw image, this does not generalize to other situations. At least one step is missing in the process."
*This statement is correct*: An edge detection step needs to be applied first for the process to work.
In the explanation of the student we would like that the student mentions that an edge detetcion should have been done previously than the hough transform.